Cloudwatch Agent IPv6 support - #1864
Merged
Merged
Conversation
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
3 times, most recently
from
September 15, 2025 19:58
5a41e29 to
ec31cd6
Compare
Paramadon
commented
Sep 15, 2025
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
from
September 15, 2025 20:15
ec31cd6 to
f2b7b99
Compare
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
2 times, most recently
from
September 15, 2025 21:41
387142e to
86123a9
Compare
- Add use_dualstack_endpoint configuration option to agent section - Set AWS_USE_DUALSTACK_ENDPOINT environment variable when enabled - Support dual-stack endpoints for CloudWatch, AMP, and other AWS services - Add dual-stack flag (-d) to config-downloader for SSM parameter retrieval - Integrate with new cmdwrapper architecture while maintaining compatibility - Add comprehensive tests for dual-stack functionality This enables IPv6 connectivity for CloudWatch Agent in dual-stack network environments.
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
from
September 15, 2025 21:44
86123a9 to
eda224e
Compare
Paramadon
marked this pull request as ready for review
September 15, 2025 22:16
Contributor
|
We also need to update and test the control scripts for Mac (under |
Contributor
|
As I understand it, users could get IPv6 support today by setting Just to confirm, what happens in each of these cases:
A table might be the best way to enumerate these |
dricross
reviewed
Sep 16, 2025
dricross
reviewed
Sep 16, 2025
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
from
September 16, 2025 19:53
529e115 to
eaf1934
Compare
dricross
reviewed
Sep 17, 2025
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
from
September 17, 2025 17:51
eaf1934 to
1ea8488
Compare
dricross
approved these changes
Sep 17, 2025
movence
reviewed
Sep 17, 2025
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
3 times, most recently
from
September 18, 2025 15:41
8297b8a to
19a37ec
Compare
Paramadon
force-pushed
the
paramadon/EnablingIpv6
branch
from
September 18, 2025 15:44
19a37ec to
ffbe4b1
Compare
movence
approved these changes
Sep 18, 2025
Paramadon
added a commit
that referenced
this pull request
Sep 21, 2025
Paramadon
added a commit
that referenced
this pull request
Sep 21, 2025
Paramadon
added a commit
that referenced
this pull request
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the issue
Currently the CloudWatch Agent does not support IPv6 environments. This means customer using IPv6 only environments will not be able to use the CWA to get telemetry.
Description of changes
This pr allows customers to be able to run the CloudWatch Agent in an IPv6 only environment. Customer simply needs to add
use_dualstack_endpoint=truein the agent configuration and what this will do is it will have all the agent endpoint calls use aws dualstack endpoints. A dual stack endpoint will work in either IPv4 or IPv6 so enabling dual stack will allow all aws sdk calls to have dual stack endpoints.How are we enabling dualstack for all sdk calls?
If the custom sets the
use_dualstack_endpoint=truein the agent section, the cloudwatch agent will set theAWS_USE_DUALSTACK_ENDPOINTto true this environment variable will automatically have all sdk used dual stack endpoints if set (as pointed out in this aws doc). This is being done in thetoEnvConfig.gofile where we see ifuse_dualstack_endpointwas specified to true and if it was, we'll set the env variable while agent is starting up (following current behavior of setting env variables at agent start up)There are some extra changes needed to support the CloudWatch Agent fully in IPv6 and those are 1. AMP custom endpoint changes and config-downloader changes.
For the AMP custom endpoint changes, we added a new field in Global_Config of the agent which is currently being used in amp translator. We parse the
use_dualstack_endpointin the apply rule and then set theGlobal_Configso that the agent knows that the customer set dual stack to true in amp translation. In the amp translator we checkGlobal_Config.UseDualStackEndpointif set to true, we'll update the amp endpoint to be dualstack endpoint.IPv4 vs dualstack amp endpoint
IPv4 AMP endpoint
https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-12345678-1234-1234-1234-123456789012/api/v1/remote_writeDualstack AMP endpoint
https://aps-workspaces.us-east-1.api.aws/workspaces/ws-12345678-1234-1234-1234-123456789012/api/v1/remote_writethe only difference between the endpoint is
amazonaws.comis changed toapi.aws. Which is exactly what we do in the translator to make amp work in an IPv6 only environmentHow about the config downloader IPv6 support?
For the config downloader the agent configuration isn't available as customer uses this to fetch their configuration from ssm parameter store. In this case customer has two options 1. Set the env variable
AWS_USE_DUALSTACK_ENDPOINTto true and run the config downloader. Or they can pass in-doption flag to theirfetch-config/append-configcall and the agent will set the env variable for them. This matches the current pattern used in the agent of using short options like for example -s, -h, etc.How about cloudwatch agent
use_dualstack_endpointvs env var precedenceCloudWatch Agent Dual-Stack Behavior Matrix (IPv6-only Environment)
Tests
All testing was done on an IPv6 only environment (IPv6 addresses only no IPv4 address) verifying that we are able to get agent metrics and also verified amp and config-dowloader:
AMP testing:
Agent json used
Successfully querying amp metrics
Config downloader testing:
CLI Command used:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -d -a fetch-config -m ec2 -c ssm:/config/standard/linux/ec2 -sCWA json in ssm parameter store
Successfully getting metrics given in the namespace of the agent json stored in the ssm parameter store
Tested config downloader dual stack changes on Windows
Agent json used:
Successful windows Testing outputs
Calling control script with -d dual stack option
use_dual_stack_endpoint set in toml
Getting metrics
Tested Mac config downloader
Tested by checking that mac control script properly config downloader with
--dualstackflag.